
import 'package:flutter/material.dart';

class RhythmPage extends StatefulWidget{

  RhythmPage({Key? key});

  @override
  State<RhythmPage> createState() => _RhythmPageState();
}

class _RhythmPageState extends State<RhythmPage>{

  @override
  Widget build(BuildContext context) {
    return CustomScrollView(
        physics: AlwaysScrollableScrollPhysics(parent: BouncingScrollPhysics()),
        slivers: <Widget>[
          SliverAppBar(
              pinned: true,
              snap: false,
              floating: false,
              expandedHeight: 120.0,
              collapsedHeight: 0,
              toolbarHeight: 0,
              stretch: true,
              backgroundColor: Colors.grey.shade400,
              flexibleSpace: FlexibleSpaceBar(
                  background: Padding(
                    padding: EdgeInsets.fromLTRB(0,MediaQuery.of(context).padding.top,0,0),
                    child:Stack(
                        fit: StackFit.expand,
                        alignment:Alignment.center,
                        children: <Widget>[
                          ConstrainedBox(
                            constraints: BoxConstraints(
                                minWidth: double.infinity,
                                minHeight: double.infinity
                            ),
                            child: DecoratedBox(
                              decoration: BoxDecoration(color: Colors.grey.shade400),
                            ),
                          ),
                          Column(
                            mainAxisAlignment: MainAxisAlignment.center,
                            mainAxisSize: MainAxisSize.min,
                            children: [
                              Text("DotCon",style: TextStyle(fontSize: 45, fontWeight: FontWeight.bold)),
                              SizedBox(height: 20),
                              Text("LED panel",style: TextStyle(fontSize: 20))
                            ],
                          ),
                          Positioned(
                              left: 20,
                              child: IconButton(
                                iconSize: 36,
                                icon: const Icon(Icons.add_circle),
                                onPressed: () { },
                              )
                          ),
                          Positioned(
                              right: 20,
                              child: IconButton(
                                iconSize: 50,
                                icon: const Icon(Icons.power_settings_new),
                                onPressed: () { },
                              )
                          ),
                        ]
                    ),
                  )
              )
          ),
          SliverToBoxAdapter(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                mainAxisSize: MainAxisSize.max,
                children: [
                  Text("Rhythm")
                ],
              )
          )
        ]
    );
  }

}